package cn.duli.xianer.service.impl;

import cn.duli.xianer.dao.WantGoodsMapper;
import cn.duli.xianer.pojo.WantGoods;
import cn.duli.xianer.service.WantGoodsService;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class WantGoodsServiceImpl implements WantGoodsService {

    @Resource
    private WantGoodsMapper wantGoodsMapper;

    @Override
    public int save(WantGoods wantGoods) {
        wantGoodsMapper.save(wantGoods);
        return wantGoods.getWgId();
    }

    @Override
    public void update(WantGoods wantGoods) {
        wantGoodsMapper.update(wantGoods);
    }

    @Override
    public WantGoods findById(Integer wgId) {
        return wantGoodsMapper.findById(wgId);
    }

    @Override
    public void deleteById(Integer wgId) {
        wantGoodsMapper.deleteById(wgId);
    }

    @Override
    public void cancelDeleteById(Integer wgId) {
        wantGoodsMapper.cancelDeleteById(wgId);
    }

    @Override
    public void shelveById(Integer wgId) {
        wantGoodsMapper.shelveById(wgId);
    }

    @Override
    public void cancelShelveById(Integer wgId) {
        wantGoodsMapper.cancelShelveById(wgId);
    }

    @Override
    public Page<WantGoods> findShelveByUserId(Integer wgUid) {
        return wantGoodsMapper.findShelveByUserId(wgUid);
    }

    @Override
    public Page<WantGoods> findVerifyIngByUid(Integer wgUid) {
        return wantGoodsMapper.findVerifyIngByUid(wgUid);
    }

    @Override
    public Page<WantGoods> findDieVerifyByUid(Integer wgUid) {
        return wantGoodsMapper.findDieVerifyByUid(wgUid);
    }

    @Override
    public Page<WantGoods> findAllVerifyIng() {
        return wantGoodsMapper.findAllVerifyIng();
    }

    @Override
    public Page<WantGoods> findDieVerify() {
        return wantGoodsMapper.findDieVerify();
    }

    @Override
    public Page<WantGoods> findSellIng() {
        return wantGoodsMapper.findSellIng();
    }

    @Override
    public Page<WantGoods> findShelved() {
        return wantGoodsMapper.findShelved();
    }

    @Override
    public void updateMode(WantGoods wantGoods) {
        wantGoodsMapper.updateMode(wantGoods);
    }

    @Override
    public Page<WantGoods> findByUserId(Integer wgUid) {
        return wantGoodsMapper.findByUserId(wgUid);
    }

    @Override
    public Page<WantGoods> findAll() {
        return wantGoodsMapper.findAll();
    }

    @Override
    public Page<WantGoods> queryLikeByGoodName(String wgName) {
        return wantGoodsMapper.queryLikeByGoodName(wgName);
    }

    @Override
    public Page<WantGoods> queryLikeByTypeName(String tName) {
        return wantGoodsMapper.queryLikeByTypeName(tName);
    }

    @Override
    public Page<WantGoods> queryLikeByAddr(String wgAddress) {
        return wantGoodsMapper.queryLikeByAddr(wgAddress);
    }

    @Override
    public Page<WantGoods> queryByTimeInterval(String startTime, String endTime) {
        return wantGoodsMapper.queryByTimeInterval(startTime, endTime);
    }

    @Override
    public Page<WantGoods> queryByTypeTwoLevelId(Integer tId) {
        return wantGoodsMapper.queryByTypeTwoLevelId(tId);
    }

    @Override
    public void updateViewNum(WantGoods wantGoods) {
        wantGoodsMapper.updateViewNum(wantGoods);
    }

    @Override
    public Page<WantGoods> queryDynamic(String startTime, String endTime, String lowPrice, String topPrice, String wgTid) {
        return wantGoodsMapper.queryDynamic(startTime, endTime, lowPrice, topPrice, wgTid);
    }

    @Override
    public int findWantGoodsCount() {
        return wantGoodsMapper.findWantGoodsCount();
    }

}
